import { createSupermapLayer } from '../../utils/layers';
import { useInjectMap } from '../../hooks/use-inject-map';
import { defineComponent } from 'vue';

export default defineComponent({
  name: 'MapSupermapLayer',
  props: {
    url: String,
  },
  setup(props, { attrs }) {
    const { map } = useInjectMap();
    const MyMapLayer = createSupermapLayer({
      url: props.url,
      ...attrs,
    });
    map?.addLayer(MyMapLayer);
  },
  render() {
    return null;
  },
});
